/**
 * jims
 */
package com.jims.master.modules.doctor.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.jims.master.common.persistence.DataEntity;
import com.jims.master.common.utils.NumberUtils;
import com.jims.master.modules.med.entity.MedicalCardConsumeMaster;
import com.jims.master.modules.med.entity.MedicalVsPatient;
import com.jims.master.modules.physical.entity.TInformation;
import org.hibernate.validator.constraints.Length;

import java.util.Date;

/**
 * 病人基本信息Entity
 * @author 赵宁
 * @version 2017-02-28
 */
public class PatMasterIndex extends DataEntity<PatMasterIndex> {
	
	private static final long serialVersionUID = 1L;
	private String name;		// 姓名
	private String inputCode;		// 姓名拼音码
	private String sex;		// 性别
	private String age;		// 年龄
	private String nation;		// 名族
    private String marriage; //婚姻
	private String nationality;		// 国籍
	private Date birthdayDate;		// 生日
	private String nativePlace;		// 籍贯
	private String zipCode;		// 邮编
	private String homeplace;		// 出生地
	private String address;		// 住址
	private String identity;		// 身份
	private String idNo;		// 身份证号
	private String phone;		// 电话
	private String contacts;		// 联系人
	private String contactsAddress;		// 联系人地址
	private String contactsPhone;		// 联系人电话
	private String unitInContract;		// 合同单位
	private String chargeType;		// 费别
    private String clinicType;//挂号状态
    private String deptId; //科室ID



	private String headPortrait;//头像，base64格式



	private String isPhy;
    private String doctorId;
    private String isDept;
	private String firstVisitIndicator;//诊别
    private String cardPayFlag;//0 可以支付  1 不可以支付\
    private String cardNo;
	private String clinicNo;
	private String registType;
	private TInformation tInformation;
	private String clinicId;


	//体检
	private String fj;
	private String zj;
	private String sf;
	private String type;
   //
   private MedicalCardConsumeMaster medicalCardConsumeMaster=new MedicalCardConsumeMaster();

    public MedicalCardConsumeMaster getMedicalCardConsumeMaster() {
        return medicalCardConsumeMaster;
    }

    public void setMedicalCardConsumeMaster(MedicalCardConsumeMaster medicalCardConsumeMaster) {
        this.medicalCardConsumeMaster = medicalCardConsumeMaster;
    }

    private MedicalVsPatient medicalVsPatient;

    public MedicalVsPatient getMedicalVsPatient() {
        return medicalVsPatient;
    }

    public void setMedicalVsPatient(MedicalVsPatient medicalVsPatient) {
        this.medicalVsPatient = medicalVsPatient;
    }

    public String getCardNo() {
        return cardNo;
    }

    public void setCardNo(String cardNo) {
        this.cardNo = cardNo;
    }

    public String getCardPayFlag() {
        return cardPayFlag;
    }

    public void setCardPayFlag(String cardPayFlag) {
        this.cardPayFlag = cardPayFlag;
    }

    public PatMasterIndex() {
		super();
	}

	public PatMasterIndex(String id){
		super(id);
	}

    public String getMarriage() {
        return marriage;
    }

    public void setMarriage(String marriage) {
        this.marriage = marriage;
    }


    @Length(min=1, max=200, message="姓名长度必须介于 1 和 200 之间")
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Length(min=0, max=50, message="姓名拼音码长度必须介于 0 和 50 之间")
	public String getInputCode() {
		return inputCode;
	}

	public void setInputCode(String inputCode) {
		this.inputCode = inputCode;
	}

	@Length(min=0, max=1, message="性别长度必须介于 0 和 1 之间")
	public String getSex() {
		return sex;
	}

	public void setSex(String sex) {
		this.sex = sex;
	}

	@Length(min=0, max=11, message="年龄长度必须介于 0 和 11 之间")
	public String getAge() {
		return age;
	}

	public void setAge(String age) {
		this.age = age;
	}

	@Length(min=0, max=1, message="名族长度必须介于 0 和 1 之间")
	public String getNation() {
		return nation;
	}

	public void setNation(String nation) {
		this.nation = nation;
	}

	@Length(min=0, max=1, message="国籍长度必须介于 0 和 1 之间")
	public String getNationality() {
		return nationality;
	}

	public void setNationality(String nationality) {
		this.nationality = nationality;
	}

	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	public Date getBirthdayDate() {
		return birthdayDate;
	}

	public void setBirthdayDate(Date birthdayDate) {
		this.birthdayDate = birthdayDate;
	}

	@Length(min=0, max=100, message="籍贯长度必须介于 0 和 100 之间")
	public String getNativePlace() {
		return nativePlace;
	}

	public void setNativePlace(String nativePlace) {
		this.nativePlace = nativePlace;
	}

	@Length(min=0, max=100, message="邮编长度必须介于 0 和 100 之间")
	public String getZipCode() {
		return zipCode;
	}

	public void setZipCode(String zipCode) {
		this.zipCode = zipCode;
	}

	@Length(min=0, max=200, message="出生地长度必须介于 0 和 200 之间")
	public String getHomeplace() {
		return homeplace;
	}

	public void setHomeplace(String homeplace) {
		this.homeplace = homeplace;
	}

	@Length(min=0, max=200, message="住址长度必须介于 0 和 200 之间")
	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	@Length(min=0, max=1, message="身份长度必须介于 0 和 1 之间")
	public String getIdentity() {
		return identity;
	}

	public void setIdentity(String identity) {
		this.identity = identity;
	}

	@Length(min=0, max=21, message="身份证号长度必须介于 0 和 21 之间")
	public String getIdNo() {
		return idNo;
	}

	public void setIdNo(String idNo) {
		this.idNo = idNo;
	}

	@Length(min=0, max=20, message="电话长度必须介于 0 和 20 之间")
	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	@Length(min=0, max=200, message="联系人长度必须介于 0 和 200 之间")
	public String getContacts() {
		return contacts;
	}

	public void setContacts(String contacts) {
		this.contacts = contacts;
	}

	@Length(min=0, max=200, message="联系人地址长度必须介于 0 和 200 之间")
	public String getContactsAddress() {
		return contactsAddress;
	}

	public void setContactsAddress(String contactsAddress) {
		this.contactsAddress = contactsAddress;
	}

	@Length(min=0, max=20, message="联系人电话长度必须介于 0 和 20 之间")
	public String getContactsPhone() {
		return contactsPhone;
	}

	public void setContactsPhone(String contactsPhone) {
		this.contactsPhone = contactsPhone;
	}

	@Length(min=0, max=200, message="合同单位长度必须介于 0 和 200 之间")
	public String getUnitInContract() {
		return unitInContract;
	}

	public void setUnitInContract(String unitInContract) {
		this.unitInContract = unitInContract;
	}

	@Length(min=0, max=1, message="费别长度必须介于 0 和 1 之间")
	public String getChargeType() {
		return chargeType;
	}

	public void setChargeType(String chargeType) {
		this.chargeType = chargeType;
	}

    public String getClinicType() {
        return clinicType;
    }

    public void setClinicType(String clinicType) {
        this.clinicType = clinicType;
    }

    public String getDeptId() {
        return deptId;
    }

    public void setDeptId(String deptId) {
        this.deptId = deptId;
    }

	public String getFirstVisitIndicator() {
		return firstVisitIndicator;
	}

	public void setFirstVisitIndicator(String firstVisitIndicator) {
		this.firstVisitIndicator = firstVisitIndicator;
	}

	public String getIsPhy() {
		return isPhy;
	}

	public void setIsPhy(String isPhy) {
		this.isPhy = isPhy;
	}

	/**
     *
     * @return
     */
    public String getDoctorId() {
        return this.doctorId;
    }

    public String getIsDept() {
        return isDept;
    }

    public void setIsDept(String isDept) {
        this.isDept = isDept;
    }

    public void setDoctorId(String doctorId) {
        this.doctorId = doctorId;
    }

	public String getClinicNo() {
		return clinicNo;
	}

	public void setClinicNo(String clinicNo) {
		this.clinicNo = clinicNo;
	}

	public String getRegistType() {
		return registType;
	}

	public void setRegistType(String registType) {
		this.registType = registType;
	}

	public String getFj() {
		return fj;
	}

	public void setFj(String fj) {
		this.fj = fj;
	}

	public String getZj() {
		return zj;
	}

	public void setZj(String zj) {
		this.zj = zj;
	}

	public String getSf() {
		return sf;
	}

	public void setSf(String sf) {
		this.sf = sf;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public TInformation gettInformation() {
		return tInformation;
	}

	public void settInformation(TInformation tInformation) {
		this.tInformation = tInformation;
	}

	public String getClinicId() {
		return clinicId;
	}

	public void setClinicId(String clinicId) {
		this.clinicId = clinicId;
	}
	public String getHeadPortrait() {
		return headPortrait;
	}

	public void setHeadPortrait(String headPortrait) {
		this.headPortrait = headPortrait;
	}

    /**
     * 是否一卡通
     * @return
     */
    public boolean isOneCard(String clinicItemId,Double clinicFee,String clinicId){
       boolean returnVal=false;
        if("0".equals(getCardPayFlag())){
            returnVal=true;
        }
        medicalCardConsumeMaster.setPatientId(getId());
        medicalCardConsumeMaster.setCardNo(getCardNo());
        medicalCardConsumeMaster.setClinicItemDictId(clinicItemId);
        medicalCardConsumeMaster.setConsumeMoney(clinicFee);//挂号费+诊疗费
        medicalCardConsumeMaster.setRcptNo(NumberUtils.getRcptNo());
        medicalCardConsumeMaster.setItemClass("Z");
        medicalCardConsumeMaster.setFeeFlag("0");
        medicalCardConsumeMaster.setFeeId(clinicId);
        return returnVal;
    }

    public void setData(){

    }
}